import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

const store = new Vuex.Store({
	state: {
		token: sessionStorage.getItem('token'),
		tabBar: [{
				iconPath: "home",
				selectedIconPath: "home-fill",
				text: '全部',
				pagePath: '/pages/index/allNews/allNews'
			},
			{
				iconPath: "star",
				selectedIconPath: "star-fill",
				text: '关注',
				pagePath: '/pages/index/news/news'
			},
			{
				iconPath: "plus",
				selectedIconPath: "plus",
				midButton: true,
				text: '发动态',
				pagePath: '/pages/index/news/'
			},
			{
				iconPath: "chat",
				selectedIconPath: "chat-fill",
				text: '消息',
				pagePath: '/pages/index/mesg/mesg'
			},
			{
				iconPath: "account",
				selectedIconPath: "account-fill",
				text: '我的',
				pagePath: '/pages/index/mine/mine'
			}
		]
	},
	mutations: {
		// payload为用户传递的值，可以是单一值或者对象
		modifyToken(state, payload) {
			state.vuex_token = payload.token;
		}
	}
})

export default store